﻿namespace easyVal.Web.Demo.Util
{
    public class TryParseUtil
    {
        public static int TryParseIntOrDefault(string input)
        {
            int output;

            if (int.TryParse(input, out output))
            {
                return output;
            }

            return 0;
        }

        public static int TryParseIntOrNeg1(string input)
        {
            int output;

            if (int.TryParse(input, out output))
            {
                return output;
            }

            return -1;
        }
        public static double TryParseDoubleOrNeg1(string input)
        {
            double output;

            if (double.TryParse(input, out output))
            {
                return output;
            }

            return -1;
        }

    }
}